package digitCount;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner reader=new Scanner(System.in);
        int n=reader.nextInt();
        int temp;
        int count=0;
        while(n!=0){
            temp=n%10;
            count+=temp;
            n=n/10;
        }
        System.out.println(count);

    }
}
